export async function contentAction ({ request, params }) {
  const data = Object.fromEntries(await request.formData())
  const res = await window.api.sql(
    'update contents set title=@title, content=@content where id=@id',
    'update',
    {
      ...data,
      id: params.id,
    },
  )
  return res
}